/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Army.building;

import Army.BuildingAndUnit;
import GameObject.Sprite;
import MOM.Center;
import MOM.Message;
import java.awt.Point;
import java.awt.image.BufferedImage;

/**
 *
 * @author Huy
 */
public class BuildingCastle extends Building {
	public static int BUILD_TIME;
	public static int FOOD;
	public static int BUILD_COST;
	public static int ATTACK_SPEED;
	public static int HEALTH_POINT;
	public static int DAMAGE;
	public static int DEFEND;
	public static int ATTACK_RANGE;
	public static int VIEW_RANGE;
	public static int SPRITE_COL;
	public static int SPRITE_ROW;
	public static Point SPRITE_MID_POINT;
	public static BufferedImage[] SPRITES;
	public static int WAGES = 100;
	private int wages=0;
	public BuildingCastle(int team) {
		init(team, 0, 0);
	}

	@Override
	public void update()
	{
		super.update();
		wages++;
		if(wages >= WAGES)
		{
			post(team, new Message(25, "waged"));
			wages = 0;
		}
		
	}
	public BuildingCastle(int team, int x, int y) {
		init(team, x, y);
	}

	private void init(int team, int x, int y) {
		this.team = team;
		size = 160;
		type = Type.BuildingCastle;
		sprite = new Sprite(SPRITES[team], SPRITE_COL, SPRITE_ROW, x, y);
		sprite.setInnerPoint(SPRITE_MID_POINT);
		armorScore = DEFEND;
		damgeScore = DAMAGE;
		attackSpeed = ATTACK_SPEED;
		attackRange = ATTACK_RANGE;
		viewRange = VIEW_RANGE;
		healthPoint = maxHealthPoint = HEALTH_POINT;
		buildCost = BUILD_COST;
		food = FOOD;
	}

	@Override
	public BuildingAndUnit create(int team, int x, int y) {
		return new BuildingCastle(team, x, y);
	}
}
